package com.pronhub.cloud.shop.util;

import org.apache.commons.codec.digest.DigestUtils;

import java.util.UUID;

public class MD5Util {

    public static String encoding(String password,String salt){
        return DigestUtils.md2Hex(""+salt.charAt(0)+salt.charAt(2)+password+salt.charAt(4)+salt.charAt(5));
    }

    public static void main(String[] args){
        String salt = UUID.randomUUID().toString().replace("-", "").substring(0, 6);
        System.err.println("sllt===>"+salt);
        String password="111111";
        System.err.println("明文"+password+".密文===>"+ MD5Util.encoding(password,salt));
    }

}
